<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSncodesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sncodes', function (Blueprint $table) {
            $table->id();
            $table->string('sn')->index()->unique()->comment('设备编码');
            $table->string('rmb')->nullable()->comment('红包金额');
            $table->string('status')->nullable()->default(0)->comment('红包领取情况');
            $table->string('user_id')->nullable()->comment('领取人');
            $table->timestamp('receive_time')->nullable()->comment('领取时间');
            $table->string('batch_id')->comment('属于那一批次');
            $table->string('comment')->index()->nullable()->comment('备注');
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sncodes');
    }
}
